HEADERS = sflow_api.h sflow.h Makefile

#INCLUDEDIRS = -I. -I/opt/libpcap/include
INCLUDEDIRS = -I. -I ../OpenWRT/Kamikaze/trunk/staging_dir/target-armeb_v5te_uClibc-0.9.31_eabi/usr/include -I ../OpenWRT/Kamikaze/trunk/build_dir/target-armeb_v5te_uClibc-0.9.31_eabi/libpcap-1.0.0

# OPT = -O2 -mcpu=i686 -march=i686 -fno-strength-reduce
OPT = -g -ggdb

CFLAGS +=-DBIGENDIAN -I ../OpenWRT/Kamikaze/trunk/staging_dir/target-armeb_v5te_uClibc-0.9.31_eabi/usr/include -I ../OpenWRT/Kamikaze/trunk/build_dir/target-armeb_v5te_uClibc-0.9.31_eabi/libpcap-1.0.0
CFLAGS += -I ../OpenWRT/Kamikaze/trunk/build_dir/linux-ixp4xx_generic/madwifi-trunk-r3314/net80211
CFLAGS  += -Wall -g
LDFLAGS += -L ../OpenWRT/Kamikaze/trunk/build_dir/target-armeb_v5te_uClibc-0.9.31_eabi/libpcap-1.0.0  -lpcap 


#CC = gcc
CC = g++

OBJS = sflow_agent.o sflow_sampler.o sflow_poller.o sflow_receiver.o sflsp.o

PROGRAM = sflsp

all: $(PROGRAM)

sflsp: $(OBJS)
	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) 

.C.o: $(HEADERS)
	$(CC) $(CFLAGS) -c $*.C

clean:
	rm -f *.o $(PROGRAM)

# dependencies
sflow_agent.o: sflow_agent.C $(HEADERS)
sflow_sampler.o: sflow_sampler.C $(HEADERS)
sflow_poller.o: sflow_poller.C $(HEADERS)
sflow_receiver.o: sflow_receiver.C $(HEADERS)
sflsp.o: sflsp.C $(HEADERS)
